
function validator(rule, value, callback) {
    if (!icu.util.jude(value, 'int')) {
        callback()
    } else {
        callback(new Error('只能为正整数'));
    }
}
let configHeader = {
    isShow: true,
    name: 'typeForm',
    labelWidth: 120,
    form: [
        { type: 'slot', label: '类型', name: 'myslot', },
        { type: 'slot', label: '系统类型', name: 'systemType', },
    ],
    rules: {},
    grid: { xl: 12, lg: 24, md: 24, sm: 24, xs: 24 },
    event: {} // 动态绑定事件
}

let configMenu = {
    isShow: true,
    name: 'menuForm',
    labelWidth: 120,
    form: [
        { type: 'input', dataType: 'text', key: 'name', label: '名称', icon: '', disabled: false, placeholder: '系统名称', showwordlimit: true, maxlength: 30, default: '' },
        { type: 'treeSelect', key: 'pid', label: '上级菜单', data: [] },
        { type: 'select', key: 'subsystemId', label: '所属系统', option: [], textAlign: 'left', placeholder: '请选择', default: '' },
        { type: 'input', dataType: 'text', key: 'route', label: '路由', icon: '', disabled: false, placeholder: '路由', showwordlimit: true, maxlength: 100, default: '' },
        { type: 'input', dataType: 'text', key: 'sort', label: '排序', icon: '', showwordlimit: true, disabled: false, placeholder: '排序', maxlength: 3, default: 0 },
        { type: 'input', dataType: 'text', key: 'permissions', label: '授权标识', icon: '', disabled: false, placeholder: '多个用逗号分隔，如：sys:menu:save', showwordlimit: true, maxlength: 100, default: '' },
        { type: 'slot', label: '图标', name: 'icon', },
        { type: 'input', dataType: 'text', key: 'remarks', label: '描述', icon: '', disabled: false, placeholder: '描述', showwordlimit: true, maxlength: 100, default: '' },
        { type: 'slot', label: '应用背景', name: 'backgroundDocId', },
        { type: 'slot', label: '工作台图标', name: 'floorIcon', },
        { type: 'input', dataType: 'text', key: 'floorRemarks', label: '工作台描述', icon: '', disabled: false, placeholder: '系统名称', showwordlimit: true, maxlength: 200, default: '' },
        { type: 'radio', key: 'hideSider', label: '隐藏侧边栏', textAlign: 'left', default: 0, radioData: [{ lable: '是', value: 1 }, { lable: '否', value: 0 }] },
        { type: 'radio', key: 'isCached', label: '是否缓存', textAlign: 'left', default: 1, radioData: [{ lable: '是', value: 0 }, { lable: '否', value: 1 }] },
        { type: '', label: '', key: 'id', },
    ],
    rules: {
        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
        pid: [{ required: true, message: '请选择上级菜单', trigger: 'blur' }],
        sort: [{ validator: validator, trigger: 'change' }],
        subsystemId: [{ required: true, message: '请选择所属系统', trigger: 'blur' }],
    },
    grid: { xl: 24, lg: 24, md: 24, sm: 24, xs: 24 },
    event: {} // 动态绑定事件
}

let configButton = {
    isShow: true,
    name: 'buttonForm',
    labelWidth: 120,
    form: [
        { type: 'input', dataType: 'text', key: 'name', label: '名称', icon: '', disabled: false, placeholder: '系统名称', showwordlimit: true, maxlength: 30, default: '' },
        { type: 'treeSelect', key: 'pid', label: '上级菜单', data: [] },
        { type: 'select', key: 'subsystemId', label: '所属系统', option: [], textAlign: 'left', placeholder: '请选择', default: '' },
        { type: 'input', dataType: 'text', key: 'sort', label: '排序', icon: '', showwordlimit: true, Zdisabled: false, placeholder: '排序', maxlength: 3, default: '' },
        // { type: 'inputNumber', key: 'sort', label: '排序', zmax: 3, main: 0, default: 1 },
        { type: 'input', dataType: 'text', key: 'permissions', label: '授权标识', icon: '', disabled: false, placeholder: '多个用逗号分隔，如：sys:menu:save', showwordlimit: true, maxlength: 100, default: '' },
        { type: 'input', dataType: 'text', key: 'remarks', label: '描述', icon: '', disabled: false, placeholder: '描述', showwordlimit: true, maxlength: 200, default: '' },
        { type: '', label: '', key: 'id', },
    ],
    rules: {
        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
        pid: [{ required: true, message: '请选择上级菜单', trigger: 'blur' }],
        sort: [{ validator: validator, trigger: 'change' }],
        subsystemId: [{ required: true, message: '请选择所属系统', trigger: 'blur' }],
    },
    grid: { xl: 24, lg: 24, md: 24, sm: 24, xs: 24 },
    event: {
    } // 动态绑定事件
}
export { configHeader, configButton, configMenu }